Dependency Injection frameworks: an improvement to testability ?
نویسندگان
چکیده
Testing is a crucial part of any software project. Its importance can be seen in the increasing amount of developer striving towards producing code with higher testability, thus being able to verify and validate the functionality of their systems. The design and structure of the code is thereby very important, to incorporate testability at a satisfying level. Dependency-Injection(DI) is a way of reversing the dependency flow between objects in a system, to make them more isolated and easier to test. As DI will help the developer to build code in a good objectoriented way by promoting thought through structure, this will lead to higher testability in the produced code. This report gives a overview of what testability is, if it can be measured and if DI frameworks can be beneficial from a testability point of view. By drawing conclusions on previous studies and work done in this field, these questions have been answered. Also a system for calculating dependency and coupling between objects is also presented, and shows that the conceptual use of DI gives more testability. The paper concludes that the use of DI frameworks will be beneficial for a systems testability, although DI itself is the major factor and not the frameworks. However as the frameworks make the use of DI that much easier there will be a significant increase in testability with the use of them.
منابع مشابه
Early Prediction of Testability by Analyzing Behavioral VHDL Specifications
A behavioral testability analysis technique is proposed for early prediction of testability by analyzing behavioral specifications written in VHDL. The technique extracts functional properties by an analysis of variable range, statement hardness and dependency relation between variables of the specification. It predicts the testability for the whole design with a low computational cost. Another...
متن کاملDependency Injection with Static Analysis and Context-Aware Policy
The dependency injection design pattern improves the configurability, testability, and maintainability of object-oriented applications by decoupling components from both the concrete implementations of their dependencies and the strategy employed to select those implementations. In recent years, a number of libraries have emerged that provide automated support for constructing and connecting de...
متن کاملAspect-Oriented Programming Beyond Dependency Injection
Dependency injection is a hot topic among industrial developers using component frameworks. This paper first mentions that dependency injection and aspect-oriented programming share the same goal, which is to reduce dependency among components for better reusability. However, existing aspect-oriented programming languages/ frameworks, in particular, AspectJ, are not perfectly suitable for expre...
متن کاملTestability Models for Object-Oriented Frameworks
Frameworks are time-tested highly reusable architectural skeleton structures. They are designed ‘abstract’ and ‘incomplete’ and are designed with predefined points of variability, known as hot spots, to be customized later at the time of framework reuse. Frameworks are reusable entities thus demand stricter and rigorous testing in comparison to onetime use application. The overall cost of frame...
متن کاملVariability-Based Models for Testability Analysis of Frameworks
Frameworks are developed to capture the recurring design practices in terms of skeletons of software subsystems/ systems. They are designed ‘abstract’ and ‘incomplete’ and are designed with predefined points of variability, known as hot spots, to be customized later at the time of framework reuse. Frameworks are reusable entities thus demand stricter and rigorous testing in comparison to one-ti...
متن کامل